<html>
  <head>
    <link type="text/css" rel="stylesheet" href="/stylesheets/sma.css" />

    <script type="text/javascript">
      function endis_other(which, input)
      {
         if (which == "other") {
            input.disabled = false;
         } else {
            input.disabled = true;
         }
      }
      function toggle(input)
      {
         if (input.disabled) {
           input.disabled = false;
         } else {
           input.disabled = true;
         }
      }
    </script>
  </head>
  <body>
    <center>
    <h1>ORUUC</h1>
    <h2>Shared Ministry Agreements</h2>
    {% if group == None %}
      <h3>Creating a New Group</h3>
    {% else %}
      <h3>Updating '{{group.sma_name}}'</h3>
      <br>Last updated {{group.sma_updated.strftime(dt_format)}} 
          by {{group.sma_updater.nickname()}}
    {% endif %}
    </center>

    <font color="red">
    {% for err in errors %}
       <br>{{err}}
    {% endfor %}
    </font>

    <!---------------------------------------------->
    <form action="/respond/save" method="post">
      {% include "post_table.html" %}

      <!---------------------------------------------->
      <h4>Section 1: Group Information</h4>
      <input type="hidden" name="group_id" value="{{group_id}}">

      <!---------------------------------------------->
      <p>Name of Group/Ministry:
      <br><input class="wide_input" type="text" name="sma_name"
                 size=80 value="{{group.sma_name}}"/>

      <!---------------------------------------------->
      <p>Purpose/Description of Group/Ministry:
        <br><textarea class="wide_input" rows="5" cols="80" 
                      name="sma_purpose_t">{{group.sma_purpose_t}}</textarea>

      <!---------------------------------------------->
      <p>Co-leaders and contact information
        <table><tr>
            <th>First Name
            <th>Last Name
            <th>Phone Number
            <th>E-mail Address
            <th>Google Username
          {% for lnum in range(3) %}
          </tr><tr>
            <td><input class="infont" type="text" name="leader{{lnum}}_fname">
            <td><input class="infont" type="text" name="leader{{lnum}}_lname">
            <td><input class="infont" type="text" name="leader{{lnum}}_phone">
            <td><input class="infont" type="text" name="leader{{lnum}}_email">
            <td><input class="infont" type="text" name="leader{{lnum}}_guser">
          {% endfor %}
        </tr></table>
      <!-- -------------------------------------------->
      <p>Members (please list at least 3, in addition to co-leaders):
        <table><tr>
            <th>First Name
            <th>Last Name
            <th>Phone Number
            <th>E-mail Address
            <th>Google Username
          {% for lnum in range(3) %}
          </tr><tr>
            <td><input class="infont" type="text" name="member{{lnum}}_fname">
            <td><input class="infont" type="text" name="member{{lnum}}_lname">
            <td><input class="infont" type="text" name="member{{lnum}}_phone">
            <td><input class="infont" type="text" name="member{{lnum}}_email">
            <td><input class="infont" type="text" name="member{{lnum}}_guser">
          {% endfor %}
        </tr></table>

      <!---------------------------------------------->
      <hr>
      <h4>Section 2: How does this group connect with the rest of
      ORUUC? (If this section is confusing, it may be easier to
      complete it in conversation with staff -- that's OK!</h4>

      <p>Staff Liason (if known):
      <br><select name="sma_staff">
        {% for staff in staff_l %}
          {% if staff_name == staff %}
          <option value="{{staff.replace(' ', '_')}}"
                  selected="selected">{{staff}}</option>
          {% else %}
          <option value="{{staff.replace(' ', '_')}}">{{staff}}</option>
          {% endif %}
        {% endfor %}
        </select>

      <!---------------------------------------------->
      <p>Coordinating Council Liason (if known):
        <table><tr>
            <th>First Name
            <th>Last Name
            <th>Phone Number
            <th>E-mail Address
            <th>Google Username
          </tr><tr>
            <td><input class="infont" type="text" name="ccl_fname">
            <td><input class="infont" type="text" name="ccl_lname">
            <td><input class="infont" type="text" name="ccl_phone">
            <td><input class="infont" type="text" name="ccl_email">
            <td><input class="infont" type="text" name="ccl_guser">
        </tr></table>
      
      <!---------------------------------------------->
      <p>ORUUC's Vision is harmonious, respectful and loving relationships with
         all of creation.
      <br>ORUUC's Mission: We are a diverse, religious community joyfulling
          nurturing one another in our lifelong spiritual journeys, and
          committing to tranform ourselves and the world around us through
          acts of compassion, love and social justice.

      <p>How does this group/ministry support ORUUC’s Vision and
      Mission?

      <br><textarea class="wide_input" rows="5" 
                    name="sma_support_t">{{group.sma_support_t}}</textarea>

      <!---------------------------------------------->
      <p>Which of the Strategic Plan's goals or objectives does this
         group/ministry PRIMARILY pursue?

        {% for goal in range(1,8) %}
            <br><input type="radio" name="sma_goal"
                       value="goal_{{goal}}"
                 {% if group.sma_goal == "goal_%d" % goal %}
                       checked
                 {% endif %}
                       />
          {{ goal_list[goal-1] }}
        {% endfor %}

      <!---------------------------------------------->
      <p>How does this ministry pursue that goal/objective?
      <br><textarea class="wide_input" rows="5"
                    name="sma_goalhow_t">{{group.sma_goalhow_t}}</textarea>

      <!---------------------------------------------->
      <p>What other Strategic Plan goals or objectives does this
      group/ministry pursue?

        <br>{{group.sma_alt_goals}}

        {% for gnum in range(1,8) %}
           <br><input type="checkbox" 
                      name="sma_altgoals"
                      value="goal_{{gnum}}"
           {% if 'goal_%d' % gnum in group.sma_altgoals %}
                      checked="1"
           {% endif %}
           />
           {{ goal_list[gnum-1] }}
        {% endfor %}

      <!---------------------------------------------->
      <p>With what other ORUUC groups (if any) does your group
      interact?
      <br><textarea class="wide_input" rows="5"
        name="sma_other_groups_t">{{group.sma_other_groups_t}}</textarea>

      <!---------------------------------------------->
      <p>How does this group share what it is doing with the wider
      congregation? (Check all that apply.)

        {% for item in comm_list %}
           <br><input type="checkbox" 
                      name="sma_comm"
                      value="{{item}}"
           {% if item in group.sma_comm %}
                      checked="1"
           {% endif %}
           {% if 'specify' in item %}
                      onclick="toggle(sma_comm_other);"
           {% endif %}
           />
           {{ item }}
           {% if 'specify' in item %}
           <input type="text" name="sma_comm_other"
                  value="{{group.sma_comm_other}}"
              {% if "Other, please specify:" not in group.sma_comm %}
                  disabled
              {% endif %}
           />
           {% endif %}
        {% endfor %}

      <!---------------------------------------------->
      <p>Are there safety/liability concerns? If so please list:
      <br><textarea class="wide_input" rows="5"
                    name="sma_safety_t">{{group.sma_safety_t}}</textarea>
        
      <!---------------------------------------------->
      <p>Section 3: GROUP PROCESS
    
      <p>Time Period
        {% for cyc in cycle_d.keys() %}
           <br><input type="radio" name="sma_cycle"
                      value="{{cyc}}"
                      id="sma_cycle_{{cyc}}"
                   {% if group.sma_cycle == cyc %}
                      checked="1"
                   {% endif %}
                      onclick="endis_other('{{cyc}}', sma_cycle_other_t);"
                      /> {{ cycle_d[cyc] }}
           {% if cyc == "other" %}
           <input type="text" name="sma_cycle_other_t"
                  value="{{group.sma_cycle_other}}" 
                  {% if group.sma_cycle != cyc %}
                  disabled
                  {% endif %}
           />
           {% endif %}
        {% endfor %}

      <!---------------------------------------------->
      <p>How do individuals join and leave the group/ministry?
      <br><textarea class="wide_input" rows="5"
                    name="sma_join_t">{{group.sma_join_t}}</textarea>

      <!---------------------------------------------->
      <p>Preferred meeting days/dates (if known) and place:
      <br><textarea class="wide_input" rows="5"
                    name="sma_timeloc_t">{{group.sma_timeloc_t}}</textarea>

      <!---------------------------------------------->
      <p>How does the group grow new leaders and plan for leadership
        succession?
        {% for s in succ_l %}
           <br><input type="checkbox" 
                      name="sma_succession"
                      value="{{ s }}"
           {% if s in group.sma_succession %}
                      checked="1"
           {% endif %}
           {% if 'specify' in s %}
                      onclick="toggle(sma_succ_other_val_t);"
           {% endif %}
               /> {{ s }}
           {% if s.startswith("Other") %}
              <input type="text" name="sma_succ_other_val_t" 
                     value="{{group.sma_succ_other_val_t}}" 
                 {% if "Other, please specify:" not in group.sma_succession %}
                     disabled
                 {% endif %}
              />
           {% endif %}
        {% endfor %}

      <!---------------------------------------------->
      <p>What does the group do or plan to do to minimize burn-out?
        {% for s in burnout_l %}
           <br><input type="checkbox" 
                      name="sma_burnout"
                      value="{{ s }}"
           {% if s in group.sma_burnout %}
                      checked="1"
           {% endif %}
           {% if 'specify' in s %}
                      onclick="toggle(sma_burn_other_val_t);"
           {% endif %}
               /> {{ s }}
           {% if s.startswith("Other") %}
              <input type="text" name="sma_burn_other_val_t" 
                     value="{{group.sma_burn_other_val_t}}"
                 {% if "Other, please specify:" not in group.sma_burnout %}
                     disabled
                 {% endif %}
              />
           {% endif %}
        {% endfor %}

      <!---------------------------------------------->
      <p>How does the group handle or plan to handle conflict?
        {% for s in conflict_l %}
           <br><input type="checkbox" 
                      name="sma_conflict"
                      value="{{ s }}"
           {% if s in group.sma_conflict %}
                      checked="1"
           {% endif %}
           {% if 'specify' in s %}
                      onclick="toggle(sma_conf_other_val);"
           {% endif %}
               /> {{ s }}
           {% if s.startswith("Other") %}
              <input type="text" name="sma_conf_other_val" 
                     value="{{group.sma_conf_other_val}}"
                 {% if "Other, please specify:" not in group.sma_conflict %}
                     disabled
                 {% endif %}
              />
           {% endif %}
        {% endfor %}

      <!---------------------------------------------->
      <p>Upon completion, or at milestones, how will you 
        celebrate/recognize/thank people, or provide closure?
      <br><textarea class="wide_input" rows="5"
              name="sma_celebrate_t">{{group.sma_celebrate_t}}</textarea>

      <!---------------------------------------------->
      <p>SECTION 4: GROUP FUNCTIONS--LEARN, SERVE, CARE

      <p>Strong religious groups, while perhaps focusing on one of these
        three functions, attend to all three. Group members learn
        together, serve the wider community (church or beyond), and care
        for each other in times of need. ORUUC groups are asked to
        attend to all three functions. Staff can assist you in
        completing this section, if that would be helpful.
        Which of the three functions is primary for your
        Group/Ministry?
        {% for f in func_l %}
           <br><input type="radio" name="sma_function" 
                      value="{{f}}"
                      {% if group.sma_function == f %}
                      checked="1"
                      {% endif %}
                      /> {{ f.capitalize() }}
        {% endfor %}

      <!---------------------------------------------->
      <p>How do you incorporate the other two functions in the life of
      your Group/Ministry?
      <br><textarea class="wide_input" rows="5"
              name="sma_altfunc_t">{{group.sma_altfunc_t}}</textarea>

      <!---------------------------------------------->
      <P>Section 5: Resources & Support
      <p>What ORUUC resources does your group/ministry need?
      <p>Staff Support:
      <br>(Please identify staff person, their role, and approximate
      number of hours.)
      <br><textarea class="wide_input" rows="5"
       name="sma_resource_staff_t">{{group.sma_resource_staff_t}}</textarea>

      <!---------------------------------------------->
      <p>Financial Resources
      <br>(Describe briefly any financial needs.)
      <br><textarea class="wide_input" rows="5"
       name="sma_resource_money_t">{{group.sma_resource_money_t}}</textarea>

      <!---------------------------------------------->
      <p>Facilities:
      <br>(Room needs)
      <br><textarea class="wide_input" rows="5"
       name="sma_resource_room_t">{{group.sma_resource_room_t}}</textarea>

      <!---------------------------------------------->
      <p>Facilities:
      <br>(Storage needs)
      <br><textarea class="wide_input" rows="5"
       name="sma_storage_t">{{group.sma_storage_t}}</textarea>

      <!---------------------------------------------->
      <p>Training
      <br>(Is there any special training or leadership development
      your group needs?)
      <br><textarea class="wide_input" rows="5"
       name="sma_resource_train_t">{{group.sma_resource_train_t}}</textarea>

      <!---------------------------------------------->
      <p>Communication needs such as church newsletter, What's
      Happening, Calendar, Facebook groups, etc.:
      <br><textarea class="wide_input" rows="5"
       name="sma_resource_comm_t">{{group.sma_resource_comm_t}}</textarea>

      <!---------------------------------------------->
      <p>Church Policies/Guidelines:
      <br>(Identify any policies or guidelines that may need to be
      created or clarified.)
      <br><textarea class="wide_input" rows="5"
       name="sma_clarification_t">{{group.sma_clarification_t}}</textarea>

      <!---------------------------------------------->
      <p>What concerns/problems do you have or anticipate?
      <br><textarea class="wide_input" rows="5"
       name="sma_concerns_t">{{group.sma_concerns_t}}</textarea>

      <!---------------------------------------------->
      <p>How could the "Shared Ministry Agreement" process be
      improved?
      <br><textarea class="wide_input" rows="5"
       name="sma_improve_t">{{group.sma_improve_t}}</textarea>

      <!---------------------------------------------->
      {% include "post_table.html" %}
    </form>
  </body>
</html>
